home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / DarkForge2000 / snippets_vol4 / snip_lowspermcount.dba < prev    next >
Encoding:
Text File  |  2000-10-13  |  1.3 KB  |  67 lines

  1. `    ------------------------------------------------------------------------
  2. `    Low Sperm Count                           DarkForge Snippet (11/10/2000)
  3. `    ------------------------------------------------------------------------
  4. `    Based on my snow code and then modified by D.Fawcett and Raven to add
  5. `    the "wind" effect. I swapped out the "dot" commands for a paste image
  6. `    because it's a lot faster.
  7.  
  8. sync rate 0
  9. sync on
  10. hide mouse
  11.  
  12. create bitmap 1,640,480
  13.  
  14. spermcount=150
  15. snow=spermcount
  16. swift = 1
  17.  
  18. dim sx(snow)
  19. dim sy(snow)
  20.  
  21. for t=0 to snow
  22.  
  23.     sx(t)=rnd(screen width())
  24.     sy(t)=rnd(screen height()-1)
  25.  
  26. next t
  27.  
  28. `        Draw the "flake"
  29.  
  30. ink rgb(255,255,255),0 : dot 1,1
  31. ink rgb(100,100,100),0 : dot 1,0 : dot 1,2 : dot 0,1 : dot 2,1
  32. get image 1,0,0,3,3
  33.  
  34. do
  35.  
  36.     cls 0
  37.  
  38.     for t=0 to snow
  39.     
  40.         if sy(t)>screen height()-1 then sy(t)=0
  41.         
  42.         v=rnd(15)+1
  43.  
  44.         if v<6 then sx(t)=sx(t)+swift
  45.         if v>10 then sx(t)=sx(t)-1*windvel#-swift
  46.         
  47.         sy(t)=sy(t)+1
  48.         
  49.         if sy(t)>screen height()-1 then sy(t)=screen height()
  50.         if sx(t)<1 then sx(t)=screen width()
  51.         
  52.         paste image 1,sx(t),sy(t)
  53.  
  54.     next t
  55.  
  56.     if rnd(200)=25 then windvel#=6
  57.     windvel#=windvel#*.99
  58.  
  59.     if windvel#>1 then swift = 0
  60.     if windvel#<1 then swift = 1
  61.  
  62.     copy bitmap 1,0
  63.     sync
  64.  
  65. loop
  66.  
  67.